package org.agent.aigccore.model.po;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.agent.aigccore.basic.serializable.BasePOBaseModel;

import java.util.Date;

/**
 * 任务流订单PO类
 */
@Setter
@Getter
@Schema(description = "任务流订单持久化对象")
public class TaskFlowOrderPO extends BasePOBaseModel {

    /**
     * 业务ID
     */
    @Schema(description = "业务ID", example = "biz_123456")
    private String bizId;
    
    /**
     * 业务类型
     */
    @Schema(description = "业务类型", example = "CHAT")
    private String bizType;
    
    /**
     * 名称
     */
    @Schema(description = "任务流名称", example = "聊天任务流")
    private String name;
    
    /**
     * 状态
     */
    @Schema(description = "任务流状态", example = "RUNNING")
    private String status;
    
    /**
     * 用户ID
     */
    @Schema(description = "用户ID", example = "user123")
    private String userId;
    
    /**
     * 拆分类型
     */
    @Schema(description = "拆分类型", example = "SEQUENTIAL")
    private String splitType;
    
    /**
     * 链数据
     */
    @Schema(description = "链数据JSON字符串", example = "{}")
    private String chainData;

    // ====== 运行模式
    /**
     * 运行规则
     */
    @Schema(description = "运行规则", example = "IMMEDIATE")
    private String runRule;
    
    /**
     * 运行规则模式
     */
    @Schema(description = "运行规则模式JSON字符串", example = "{}")
    private String runRuleMode;

    // ====== 运行信息
    /**
     * 执行次数
     */
    @Schema(description = "执行次数", example = "5")
    private Integer execNum;
    
    /**
     * 失败次数
     */
    @Schema(description = "失败次数", example = "1")
    private Integer failNum;
    
    /**
     * 开始执行时间
     */
    @Schema(description = "开始执行时间", example = "2024-01-01T10:00:00")
    private Date startExecTime;
    
    /**
     * 截止执行时间
     */
    @Schema(description = "截止执行时间", example = "2024-01-01T18:00:00")
    private Date deadlineExecTime;
    
    /**
     * 首次执行时间
     */
    @Schema(description = "首次执行时间", example = "2024-01-01T10:00:00")
    private Date firstExecTime;
    
    /**
     * 最后执行时间
     */
    @Schema(description = "最后执行时间", example = "2024-01-01T15:00:00")
    private Date lastExecTime;

    // ====== 链信息
    /**
     * 根任务ID
     */
    @Schema(description = "根任务ID", example = "task_root_123")
    private String rootTaskId;
    
    /**
     * 终端任务ID
     */
    @Schema(description = "终端任务ID", example = "task_terminal_456")
    private String terminalTaskId;
    
    /**
     * 运行上游任务
     */
    @Schema(description = "运行上游任务列表", example = "task1,task2")
    private String runUpstreamTask;
    
    /**
     * 运行下游任务
     */
    @Schema(description = "运行下游任务列表", example = "task3,task4")
    private String runDownstreamTask;

    // ====== 外部业务信息
    /**
     * 链别名
     */
    @Schema(description = "链别名", example = "chat_chain")
    private String chainAlias;
    
    /**
     * 外部业务ID
     */
    @Schema(description = "外部业务ID", example = "ext_biz_789")
    private String outBizId;
    
    /**
     * 外部业务标识
     */
    @Schema(description = "外部业务标识", example = "CHAT_SESSION")
    private String outBizFlag;
    
    /**
     * 外部业务数据
     */
    @Schema(description = "外部业务数据JSON字符串", example = "{}")
    private String outBizData;
    
    /**
     * 来源
     */
    @Schema(description = "来源", example = "aigccore")
    private String source;


    // ====== 其他
    /**
     * 环境
     */
    @Schema(description = "环境", example = "dev")
    private String env;
    
    /**
     * 日期
     */
    @Schema(description = "日期", example = "2024-01-01")
    private Date dt;
    
    /**
     * 执行系统
     */
    @Schema(description = "执行系统", example = "local")
    private String execSystem;
    
    /**
     * 自动触发
     */
    @Schema(description = "自动触发", example = "1")
    private Integer autoTrigger;
}
